/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DialogCadSaidaCheque.java
 *
 * Created on 15/11/2011, 19:13:36
 */
package camada.apresentacao.dialog.cheques;

import camada.bancodedados.daoimplemente.cheques.ChequeDAOImpl;
import eloma.classe.SaidaCheques;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.ListSelectionModel;
import tabelamodelcolumnmodel.cheque.EntradaChequeColumnModel;
import tabelamodelcolumnmodel.cheque.EntradaChequeTableModel;
import utilitarios.Exceptions;

/**
 *
 * @author icaro
 */
public class DialogCadEntradaCheque extends javax.swing.JDialog {

    ChequeDAOImpl daoSaidaCheque = new ChequeDAOImpl();
    int indexTabela;
    boolean atualizar = false;
    Exceptions exceptions = new Exceptions();

    /**
     * Creates new form DialogCadSaidaCheque
     */
    public DialogCadEntradaCheque(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        setLocationRelativeTo(null);
        setTitle("Cadastrar Cheque");
        carregarTabela(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtNumeroCheque = new javax.swing.JFormattedTextField();
        jLabel2 = new javax.swing.JLabel();
        txtDescricao = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        txtValor = new javax.swing.JFormattedTextField();
        btAdicionar = new javax.swing.JButton();
        btEditar = new javax.swing.JButton();
        btRemover = new javax.swing.JButton();
        btCancelar = new javax.swing.JButton();
        btSalvar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabelaSaidaCheque = new javax.swing.JTable();
        btVoltar = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel1.setText("Número Cheque:");

        txtNumeroCheque.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
        txtNumeroCheque.setEnabled(false);

        jLabel2.setText("Descrição:");

        txtDescricao.setEnabled(false);

        jLabel3.setText("Valor:");

        txtValor.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#,##0.###"))));
        txtValor.setEnabled(false);

        btAdicionar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ima/cadastro/Add.png"))); // NOI18N
        btAdicionar.setText("Adicionar");
        btAdicionar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAdicionarActionPerformed(evt);
            }
        });

        btEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ima/cadastro/Editar.png"))); // NOI18N
        btEditar.setText("Editar");
        btEditar.setEnabled(false);
        btEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btEditarActionPerformed(evt);
            }
        });

        btRemover.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ima/cadastro/Remove.png"))); // NOI18N
        btRemover.setText("Remover");
        btRemover.setEnabled(false);
        btRemover.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btRemoverActionPerformed(evt);
            }
        });

        btCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ima/cadastro/Cancel.png"))); // NOI18N
        btCancelar.setText("Cancelar");
        btCancelar.setEnabled(false);
        btCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelarActionPerformed(evt);
            }
        });

        btSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ima/cadastro/Save.png"))); // NOI18N
        btSalvar.setText("Salvar");
        btSalvar.setEnabled(false);
        btSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txtNumeroCheque, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(txtValor, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(btAdicionar, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btSalvar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btEditar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btRemover)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNumeroCheque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtValor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btAdicionar)
                    .addComponent(btCancelar)
                    .addComponent(btRemover)
                    .addComponent(btEditar)
                    .addComponent(btSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        tabelaSaidaCheque.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tabelaSaidaCheque.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaSaidaChequeMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tabelaSaidaCheque);

        btVoltar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ima/cadastro/Voltar.png"))); // NOI18N
        btVoltar.setText("Voltar");
        btVoltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btVoltarActionPerformed(evt);
            }
        });

        jButton1.setText("jButton1");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btVoltar, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane1))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btVoltar)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btVoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btVoltarActionPerformed

        this.hide();     }//GEN-LAST:event_btVoltarActionPerformed

    private void btAdicionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAdicionarActionPerformed

        txtNumeroCheque.setText("");
        txtDescricao.setText("");
        txtValor.setText("");

        //Ativar Campos
        txtNumeroCheque.setEnabled(true);
        txtDescricao.setEnabled(true);
        txtValor.setEnabled(true);

        //Ativar Desativar Botões
        btAdicionar.setEnabled(false);
        btSalvar.setEnabled(true);
        btEditar.setEnabled(false);
        btRemover.setEnabled(false);
        btCancelar.setEnabled(true);
        btVoltar.setEnabled(false);

    }//GEN-LAST:event_btAdicionarActionPerformed

    private void btCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelarActionPerformed

        //Desativar Campos
        txtNumeroCheque.setEnabled(false);
        txtDescricao.setEnabled(false);
        txtValor.setEnabled(false);

        //Ativar Desativar Botões
        btAdicionar.setEnabled(true);
        btSalvar.setEnabled(false);
        btEditar.setEnabled(false);
        btRemover.setEnabled(false);
        btCancelar.setEnabled(false);
        btVoltar.setEnabled(true);

        txtNumeroCheque.setText("");
        txtDescricao.setText("");
        txtValor.setText("");

    }//GEN-LAST:event_btCancelarActionPerformed

    private void tabelaSaidaChequeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaSaidaChequeMouseClicked
        try {

            indexTabela = tabelaSaidaCheque.getSelectedRow();

            EntradaChequeTableModel modelTabela = (EntradaChequeTableModel) tabelaSaidaCheque.getModel();

            SaidaCheques saidaCheque = modelTabela.getValoresSaidaCheque(indexTabela);

            txtNumeroCheque.setText(String.valueOf(saidaCheque.getNumeroCheque()));
            txtDescricao.setText(saidaCheque.getDescricao());
            txtValor.setText(String.valueOf(saidaCheque.getValorCheque()));

            //Desativar Campos
            txtNumeroCheque.setEnabled(false);
            txtDescricao.setEnabled(false);
            txtValor.setEnabled(false);

            //Ativar Desativar Botões
            btAdicionar.setEnabled(false);
            btSalvar.setEnabled(false);
            btEditar.setEnabled(true);
            btRemover.setEnabled(true);
            btCancelar.setEnabled(true);
            btVoltar.setEnabled(false);

        } catch (Exception ex) {
            exceptions.Exceptions(ex.getMessage().toString(), "DialogCadSaidaCheque-tabelaSaidaChequeMouseClicked");
        }
    }//GEN-LAST:event_tabelaSaidaChequeMouseClicked

    public void carregarOutrasConsultas() {
        try {

//            List<SaidaCheques> listaSaidaCheque = new ArrayList<SaidaCheques>();
//
//            int mes = cpMes.getMonth() + 1;
//            int ano = cpAno.getYear();
//
//            if (rbTodos.isSelected() == true) {
//
//                listaSaidaCheque = daoSaidaCheque.selecionarSaidaChequesTodosPorAnoEMes(ano, mes);
//
//                carregarTabela(listaSaidaCheque);
//
//            } else if (rbAberto.isSelected() == true) {
//
//                listaSaidaCheque = daoSaidaCheque.selecionarSaidaChequesAbertosBaixadosPorAnoEMes(ano, mes, null);
//
//                carregarTabela(listaSaidaCheque);
//
//            } else if (rbBaixados.isSelected() == true) {
//
//                listaSaidaCheque = daoSaidaCheque.selecionarSaidaChequesAbertosBaixadosPorAnoEMes(ano, mes, "OK");
//
//                carregarTabela(listaSaidaCheque);
//
//            }
        } catch (Exception ex) {
            exceptions.Exceptions(ex.getMessage().toString(), "DialogCadSaidaCheque-carregarOutrasConsultas");
        }
    }

    private void btRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btRemoverActionPerformed
        try {

            EntradaChequeTableModel modelTabela = (EntradaChequeTableModel) tabelaSaidaCheque.getModel();

            SaidaCheques saidaCheque = modelTabela.getValoresSaidaCheque(indexTabela);

            daoSaidaCheque.removerCheque(saidaCheque.getIdCheque());

            carregarTabela(null);

            //Desativar Campos
            txtNumeroCheque.setEnabled(false);
            txtDescricao.setEnabled(false);
            txtValor.setEnabled(false);

            //Ativar Desativar Botões
            btAdicionar.setEnabled(true);
            btSalvar.setEnabled(false);
            btEditar.setEnabled(false);
            btRemover.setEnabled(false);
            btCancelar.setEnabled(false);
            btVoltar.setEnabled(true);

            txtNumeroCheque.setText("");
            txtDescricao.setText("");
            txtValor.setText("");

        } catch (Exception ex) {
            exceptions.Exceptions(ex.getMessage().toString(), "DialogCadSaidaCheque-btRemoverActionPerformed");
        }
    }//GEN-LAST:event_btRemoverActionPerformed

    private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
        try {

            if (atualizar == false) {

                if (Integer.parseInt(txtValor.getText()) > 0) {

                    SaidaCheques saCheques = new SaidaCheques();
                    saCheques.setNumeroCheque(Integer.parseInt(txtNumeroCheque.getText()));
                    saCheques.setDescricao(txtDescricao.getText());
                    saCheques.setValorCheque(Float.parseFloat(txtValor.getText()));
                    saCheques.setSituacao("Pendente");

                    daoSaidaCheque.inserirCheque(saCheques);

                    carregarTabela(null);

                } else {
                    JOptionPane.showMessageDialog(null, "O valor do cheque tem que ser maior que zero");
                }

            } else if (atualizar == true) {

                EntradaChequeTableModel modelTabela = (EntradaChequeTableModel) tabelaSaidaCheque.getModel();

                SaidaCheques saidaCheque = modelTabela.getValoresSaidaCheque(indexTabela);

                saidaCheque.setNumeroCheque(Integer.parseInt(txtNumeroCheque.getText()));
                saidaCheque.setDescricao(txtDescricao.getText());
                saidaCheque.setValorCheque(Float.parseFloat(txtValor.getText()));

                daoSaidaCheque.atualizarCheque(saidaCheque);

                carregarTabela(null);

                atualizar = false;
            }

            //Desativar Campos
            txtNumeroCheque.setEnabled(false);
            txtDescricao.setEnabled(false);
            txtValor.setEnabled(false);

            //Ativar Desativar Botões
            btAdicionar.setEnabled(true);
            btSalvar.setEnabled(false);
            btEditar.setEnabled(false);
            btRemover.setEnabled(false);
            btCancelar.setEnabled(false);
            btVoltar.setEnabled(true);

            txtNumeroCheque.setText("");
            txtDescricao.setText("");
            txtValor.setText("");

        } catch (Exception ex) {
            exceptions.Exceptions(ex.getMessage().toString(), "DialogCadSaidaCheque-btSalvarActionPerformed");
        }
    }//GEN-LAST:event_btSalvarActionPerformed

    private void btEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btEditarActionPerformed

        atualizar = true;

        //Desativar Campos
        txtNumeroCheque.setEnabled(true);
        txtDescricao.setEnabled(true);
        txtValor.setEnabled(true);

        //Ativar Desativar Botões
        btAdicionar.setEnabled(false);
        btSalvar.setEnabled(true);
        btEditar.setEnabled(false);
        btRemover.setEnabled(false);
        btCancelar.setEnabled(true);
        btVoltar.setEnabled(false);

    }//GEN-LAST:event_btEditarActionPerformed

    private void carregarTabela(List<SaidaCheques> lista) {
        try {

            List<SaidaCheques> listaSaidaCheques;

            if (lista != null) {
                listaSaidaCheques = lista;
            } else {
                listaSaidaCheques = daoSaidaCheque.selecionarTodosCheque();
            }

            tabelaSaidaCheque.setModel(new EntradaChequeTableModel(listaSaidaCheques));

            tabelaSaidaCheque.setAutoCreateColumnsFromModel(false);
            java.awt.FontMetrics fm = tabelaSaidaCheque.getFontMetrics(tabelaSaidaCheque.getFont());

            tabelaSaidaCheque.setColumnModel(new EntradaChequeColumnModel(fm));
            tabelaSaidaCheque.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

        } catch (Exception ex) {
            exceptions.Exceptions(ex.getMessage().toString(), "DialogCadSaidaCheque-carregarTabela");
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(DialogCadEntradaCheque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(DialogCadEntradaCheque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(DialogCadEntradaCheque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DialogCadEntradaCheque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                DialogCadEntradaCheque dialog = new DialogCadEntradaCheque(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btAdicionar;
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btEditar;
    private javax.swing.JButton btRemover;
    private javax.swing.JButton btSalvar;
    private javax.swing.JButton btVoltar;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable tabelaSaidaCheque;
    private javax.swing.JTextField txtDescricao;
    private javax.swing.JFormattedTextField txtNumeroCheque;
    private javax.swing.JFormattedTextField txtValor;
    // End of variables declaration//GEN-END:variables
}
